home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr37 / ducal114.zip / DUCALL1.WCC < prev    next >
Text File  |  1995-03-02  |  38KB  |  1,206 lines

  1. 'DuCall version 1.14ß........................by David L. Kuhn and
  2. '                                            Dimensions Unlimited
  3. '
  4. ' copyright(c) 1995
  5. '
  6. ' Callback verifier for Wildcat 4.01
  7. '
  8. '
  9. 'Revision history:
  10. '
  11. '  Version 1.00α, 29 Jan 95: Made the original version. Initial testing
  12. '                            look good!
  13. '  Version 1.02α, 30 Jan 95: Cleaned up, Added a much more detailed Sysop
  14. '                            messaging system.
  15. '  Version 1.03α, 30 Jan 95: Fixed a bug of finding the current user's phone
  16. '                            number in the user database under his own user
  17. '                            record!!! Ooops!
  18. '  Version 1.04α, 30 Jan 95: Tweaked multi-verification system
  19. '  Version 1.05α, 30 Jan 95: Added support for Sysop to specify the name of
  20. '                            Main Menu as named in the description field
  21. '                            for the main menu in MakeMenu.
  22. '  Version 1.06α, 30 Jan 95: Added file locking logic. Adding multiple call
  23. '                            try coding.
  24. '  Version 1.07α, 18 Feb 95: Added LD Time Checking
  25. '  Version 1.10ß, 18 Feb 95: Bug fix for LD Time Checking
  26. '                            Added Bad Verification Message to Sysop function
  27. '                            Added program pathname support
  28. '  Version 1.11ß, 18 Feb 95: Added a few more bad sysop message triggers
  29. '  Version 1.12ß, 18 Feb 95: Removed the extra version # in middle of some
  30. '                            screens.  Corrected CarrierOn Detection while
  31. '                            writtin auditrail & badsysopmsg during the dial
  32. '                            attempt process.
  33. '  Version 1.13ß,  1 Mar 95: added expiration date option
  34. '                            added feature to treat all calls as long
  35. '                            distance.
  36. '                            fixed an oversite where the welcome message to
  37. '                            both the user and the sysop was not being sent
  38. '                            if the user was long distance
  39. '                            added date format to configuration
  40. '                            cleaned two more screens
  41. '                            added support for sysops without a local prefix
  42. '                            control file (see config file for details)
  43. '  Version 1.14ß,  2 Mar 95: Fixed the LD Time Allowed routine.  It was too
  44. '                            complicated and didn't work.  This time I just
  45. '                            do a brute forse time allowed test and test for
  46. '                            all combinations of start & stop times.
  47. '
  48. 'About the program:
  49. '
  50. 'This program was built from a basic idea that was posted on MSI
  51. 'by John Livingston and from the callback example in the WcCode manual.
  52. 'It includes a simple interface, proper checking of phone prefixes, proper
  53. 'checking of 911, 411, 800, 900 & 555 phone numbers, configurable security
  54. ' level masks, welcome mail and an audit trail.
  55. '
  56. 'It requires three external files.  One called 'duclocl.cfg' which has the
  57. 'numbers of the valid (toll free) exchanges in your area.  One called
  58. 'DUCWEL.MSG which contains your general message to successful upgraders.
  59. 'And finally, one called ducall.cfg which has the general configuration for
  60. 'the program and security level that the successful call back awards to the
  61. 'newuser.  This file MUST be edited for each BBS systyem! All files are
  62. 'mandatory!
  63. '
  64. 'This program writes to a file called ducall.log and to the user database.
  65. '
  66. '                           HELLO!
  67. '
  68. 'You must have a welcome message for your newly upgraded user in the
  69. 'file called DUCWEL.MSG.  When the user gets upgraded, this file is
  70. 'sent as a private message to him/her.
  71. '
  72. '                           HELLO!
  73. '
  74. 'This program is not guaranteed to do anything except take up
  75. 'space on your hard drive.  In addition, since it adjusts your database, I
  76. 'cannot be responsible for any damage or errors caused when using this
  77. 'program.  User beware!
  78. '
  79. CarrierCheck On
  80. '
  81. dim dfmat as string
  82. dim all_ld as integer
  83. dim dialing as integer
  84. dim problem as string
  85. dim CTimeNow as Time
  86. dim ldstart as time
  87. dim ldstarttemp as string
  88. dim ldstoptemp as string
  89. dim ldstop as time
  90. dim ldvfyok as integer
  91. dim mainmenu as string
  92. dim sysopsec as string
  93. dim sysopname as string
  94. dim ducallver as string
  95. dim justentered as integer
  96. dim doit as string*1
  97. dim phone as string*8
  98. dim test_phone as string*3
  99. dim dummy as string
  100. dim name1 as string*25
  101. dim x as integer
  102. dim answer as string*1
  103. dim msgconf as integer
  104. dim phonenum as string*15
  105. dim bbsname as string
  106.  
  107. Function ChkLDTime
  108.    '
  109.    if all_ld=1 then LdVfyOk=True: Exit Function
  110.    If FormatTime(LDStop, "hh:mm") = FormatTime(LDStart, "hh:mm") then LdVfyOk=True: Exit Function
  111.    '
  112.    ' Assume false unles proven otherwise
  113.    '
  114.    LDVFYOK = False
  115.    '
  116.    If FormatTime(CTimeNow, "hh:mm") >= FormatTime(LDStart, "hh:mm") then
  117.      If FormatTime(CTimeNow, "hh:mm") <= FormatTime(LDStop, "hh:mm") then
  118.         '
  119.         ' Current Time is greater than the start time and the
  120.         ' Current Time is is less than the stop time. Simple time calc.
  121.         '
  122.         LDVFYOK = True
  123.      end if
  124.      '
  125.      If FormatTime(LDStop, "hh:mm") < FormatTime(LDStart, "hh:mm") then
  126.        '
  127.        ' Current time is after start time, but stop time is before start time
  128.        ' Stop Time midnight rollover
  129.        '
  130.        LDVFYOK = True
  131.      end if
  132.      '
  133.    elseif FormatTime(CTimeNow, "hh:mm") < FormatTime(LDStart, "hh:mm") then
  134.      '
  135.      ' Current Time is less than the start time
  136.      '
  137.      if FormatTime(CTimeNow, "hh:mm")<=FormatTime(LDStop,"hh:mm") then
  138.        IF FormatTime(LDStart, "hh:mm")>FormatTime(LDStop,"hh:mm") then
  139.          '
  140.          ' if current time is less than both the stop and start times, the
  141.          ' start time must have been before midnight and the stop time some
  142.          ' time before the start time!  Roll-Over!
  143.          '
  144.          LDVFYOK = True
  145.        end if
  146.      end if
  147.    End If
  148.    '
  149. End Function
  150.  
  151. sub typeit(betyped as string,scrcol as integer,scrfg as integer,scrbg as integer)
  152. ' this sub make a character string look like it's being typed on the
  153. ' screen before the users eyes. Cute.
  154. ' Requires ansidectected!
  155. dim a as integer
  156. dim y as integer
  157. a=csrlin
  158. if scrcol=0 then
  159.   scrcol=(80-len(betyped))/2
  160. end if
  161. print chr(13);"@"+right(hex(scrbg),1)+right(hex(scrfg),1)+"@";chr(13);
  162. for y=1 to len(betyped)
  163.   locate a,y+scrcol
  164.   print mid(betyped,y,1);
  165.   if y<>len(betyped) then delay .01
  166. next y
  167. print
  168. end sub
  169.  
  170. sub shiftit(beshifted as string,scrcol as integer,scrfg as integer,scrbg as integer)
  171. ' This sub brings a character string in from the right of the screen and
  172. ' scrolls those characters to a specified screen column.  If the specified
  173. ' screen column is zero, the character string gets centered on the screen.
  174. ' Requires ansidectected!
  175. dim a as integer
  176. dim c as integer
  177. dim y as integer
  178. if scrcol=0 then
  179.   scrcol=(80-len(beshifted))/2
  180. end if
  181. print chr(13);"@"+right(hex(scrbg),1)+right(hex(scrfg),1)+"@";chr(13);
  182. a=csrlin
  183. c=1
  184. for y=79 to scrcol step-1
  185.   locate a,y
  186.   print left(beshifted,c);
  187.   clreol
  188.   c=c+1
  189.   if c>len(beshifted) then c=len(beshifted)
  190.   delay .01
  191. next y
  192. print
  193. end sub
  194.  
  195. sub center(tobecentered as string,scrfg as integer,scrbg as integer)
  196. 'This routine simply centers a character screen in the center of the
  197. 'current line.  Does not require ansidetected!
  198. dim a as integer
  199. dim b as integer
  200. dim scrcol as integer
  201. dim dummy2 as string
  202. dim y as integer
  203. a=0
  204. dummy2=tobecentered
  205. print chr(13);"@"+right(hex(scrbg),1)+right(hex(scrfg),1)+"@";chr(13);
  206. scrcol=80-len(ltrim(dummy2))
  207. for y=1 to len(tobecentered)
  208.   if mid(tobecentered,Y,1)="@" then a=a+1
  209. next y
  210. b=int(a/2)
  211. scrcol=(scrcol/2)+b
  212. print chr(13);string(scrcol," ");ltrim(dummy2);
  213. print
  214. end sub
  215.  
  216. Sub audittrail
  217. 'This sub opens an audit trail and appends whatever is in string
  218. 'DUMMY to the log file DUCALL.LOG.  The first time it is called,
  219. 'the user's name is recorded.  Each time it called, the time and date
  220. 'are recorded.  This function is useful for debug, for tracking pests
  221. 'and for just being able to see what the door is doing for you.
  222. 'It doesn't log Sysop activity.
  223. 'Since WcCode app selection is not recorded in the Activity log, this
  224. 'replaces that void.
  225.  
  226. if user.Seclevel = rtrim(sysopsec) then exit sub
  227. Const DateMask = "mm/dd/yyyy"
  228. Const TimeMask = "hh:mm:ss"
  229. Dim today as date
  230. dim timenow as time
  231. dim ff as integer
  232. currentdate(today)
  233. currenttime(timenow)
  234. ff=freefile
  235. open ProgPath+"ducall.log" for append as #ff
  236.   carrierCheck Off
  237.   lockfile(ff,0,1)
  238.   if dummy<>string(79,"─") then
  239.     if justentered=1 then
  240.       print #ff,dummy;" at "formattime(timenow,timemask)" on "formatdate(today,dfmat)
  241.     else
  242.       print #ff,user.name ;dummy;" at "formattime(timenow,timemask)" on "formatdate(today,dfmat)
  243.     end if
  244.   else
  245.     print #ff,string(79,"─")
  246.   end if
  247.   unlockfile(ff,0,1)
  248.   IF Dialing=0 then carriercheck on
  249. close #ff
  250. end sub
  251.  
  252. sub waitkp
  253. ' Stolen from an example in the WcCode Conference on MSI
  254. dim pcolor as integer
  255. print
  256. pcolor = 9
  257. do
  258.  print chr(13);"@"+right(hex(pcolor),2)+"@";"Press ENTER to continue...";
  259.  pcolor = pcolor + 1
  260.  if pcolor > 15 then
  261.    pcolor = 9
  262.  end if
  263.  delay 0.5
  264. loop until inkey = chr(13)
  265. end sub
  266.  
  267. sub SendSysopBadMsg
  268. ' Prefix was not found
  269. dim msg as MessageHeader
  270. dim ff as integer
  271.  
  272. if exists(ProgPath+"DUCSBAD.MSG") then kill ProgPath+"DUCSBAD.MSG"
  273. ff=freefile
  274. open ProgPath+"DUCSBAD.MSG" for output as #ff
  275.   CarrierCheck off
  276.   lockfile(ff,0,1)
  277.   print #ff,"@03@NEW USER:@0F@ "+user.name
  278.   print #ff,"@03@BAD DATA NUMBER:@0F@ "+phonenum+"@0E@"
  279.   print #ff,"@03@PROBLEM:@0F@ "+Problem+"@0E@"
  280.   print #ff, ""
  281.   print #ff, "The above listed user was not verified, by DuCall, on the Date"
  282.   print #ff, "shown in the upper right hand corner.  Please check your DUCCLOCL.CFG"
  283.   print #ff, "control file to see if the caller's prefix is in your database of"
  284.   print #ff, "local phone numbers."
  285.   print #ff, ""
  286.   print #ff, "@0F@═ @02@DuCall is a Copyright(c) of Dimensions Unlimited, 1995@0F@ ═"
  287.   unlockfile(ff,0,1)
  288.   IF Dialing=0 then carriercheck on
  289. Close #ff
  290.  
  291. msg.From="DuCall "+DuCallVer
  292. msg.To=SysopName
  293. msg.Subject="New User Verified"
  294. msg.flags=msg.flags OR 1
  295. AddMessage(msg,ProgPath+"DUCSBAD.MSG",,msgconf)
  296.  
  297. if exists(ProgPath+"DUCSBAD.MSG") then kill ProgPath+"DUCSBAD.MSG"
  298.  
  299. end sub
  300.  
  301. sub SendWelcomeMessage
  302. 'First, we send a welcome to the user, then we notify the sysop
  303. dim msg as MessageHeader
  304. dim ff as integer
  305.  
  306. msg.From=SysopName
  307. msg.To=user.name
  308. msg.Subject="Welcome!"
  309. msg.flags=msg.flags OR 1
  310. AddMessage(msg,ProgPath+"ducwel.msg",,msgconf)
  311.  
  312. if exists(ProgPath+"DUCSYSOP.MSG") then kill ProgPath+"DUCSYSOP.MSG"
  313. ff=freefile
  314. open ProgPath+"DUCSYSOP.MSG" for output as #ff
  315.   CarrierCheck off
  316.   lockfile(ff,0,1)
  317.   print #ff,"@03@NEW USER:@0F@ "+user.name
  318.   print #ff,"@03@VERIFIED DATA NUMBER:@0F@ "+phonenum+"@0E@"
  319.   print #ff, ""
  320.   print #ff, "The above listed user has been verified by DuCall, on the Date"
  321.   print #ff, "shown in the upper right hand corner. The Data Number has been"
  322.   print #ff, "added to the User's Record under the DATANUMBER category..."
  323.   print #ff, ""
  324.   print #ff, "A message has been sent to @0F@"+user.name+"@0E@"
  325.   print #ff, "thanking him/her for calling."
  326.   print #ff, ""
  327.   print #ff, "@0F@═ @02@DuCall is a Copyright(c) of Dimensions Unlimited, 1995@0F@ ═"
  328.   unlockfile(ff,0,1)
  329.   carriercheck on
  330. Close #ff
  331.  
  332. msg.From="DuCall "+DuCallVer
  333. msg.To=SysopName
  334. msg.Subject="New User Verified"
  335. msg.flags=msg.flags OR 1
  336. AddMessage(msg,ProgPath+"DUCSYSOP.MSG",,msgconf)
  337.  
  338. if exists(ProgPath+"DUCSYSOP.MSG") then kill ProgPath+"DUCSYSOP.MSG"
  339.  
  340. end sub
  341. ' ********************************
  342. ' *** MAIN PROGRAM STARTS HERE ***
  343. ' ********************************
  344. dim timenow as time
  345. dim uselocal as integer
  346. dim expiredate as date
  347. dim expiredays as integer
  348. dim z as integer
  349. dim y as integer
  350. dim ff as integer
  351. dim pcolor as integer
  352. dim ld as integer
  353. dim dialld as integer
  354. dim temp as string
  355. dim presec as string
  356. dim aftersec as string
  357. dim cscrln as integer
  358. dim areacode as string
  359. dim prefix as string
  360. dim extension as string
  361. dim userrec as userrecord
  362. dim dupenumber as integer
  363. dim prefixmatch as integer
  364. dim password1 as string*14
  365. dim commentline as integer
  366. dim timebalance as integer
  367. dim duplicatenumbers as integer
  368. dim thisrecord
  369. dim tries as integer
  370. Dim StartTime as Real
  371.  
  372. ducallver="1.14ß"
  373.  
  374. CurrentTime(CTimeNow)
  375.  
  376. dummy=" entered callback verifier "
  377. audittrail
  378.  
  379. justentered=1
  380. if not exists(ProgPath+"DUCWEL.MSG") then
  381.   print
  382.   print "!!! SYSOP ERROR !!! Welcome Message test not found!",12,0
  383.   print
  384.   waitkp
  385.   dummy=" "+ProgPath+"DUCWEL.MSG not found, aborting "
  386.   audittrail
  387.   goto DucEnd
  388. end if
  389. if not exists(ProgPath+"DUCALL.CFG") then
  390.   print
  391.   center "!!! SYSOP ERROR !!! Configuration File not found!", 12,0
  392.   print
  393.   waitkp
  394.   dummy=" configuration file error!!! "
  395.   audittrail
  396.   goto DucEnd
  397. else
  398.   ff=freefile
  399.   open ProgPath+"DUCALL.CFG" for input as FF
  400.     carriercheck off
  401.     lockfile(ff,0,1)
  402.     input #ff, bbsname
  403.     input #ff, sysopname
  404.     input #ff, temp
  405.       ld=val(temp)
  406.       if ld=1 then
  407.         dummy=" long distance allowed "
  408.         audittrail
  409.       end if
  410.     input #ff, presec
  411.     input #ff, aftersec
  412.     input #ff, sysopsec
  413.     input #ff, temp
  414.       msgconf=val(temp)
  415.     input #ff, temp
  416.       commentline=val(temp)
  417.     input #ff, temp
  418.       timebalance=val(temp)
  419.     input #ff, temp
  420.       duplicatenumbers=val(temp)
  421.     input #ff, mainmenu
  422.     input #ff, temp
  423.       tries=val(temp)
  424.     Input #ff, temp
  425.       LDStarttemp=rtrim(temp)
  426.     Input #ff, temp
  427.       LDStoptemp=rtrim(temp)
  428.     input #ff, temp
  429.       ExpireDays=Val(Temp)
  430.     input #ff, temp
  431.       all_ld = Val(Temp)
  432.     input #ff, temp
  433.       dfmat = rtrim(ltrim(temp))
  434.     input #ff, temp
  435.       UseLocal = Val(Temp)
  436.     unlockfile(ff,0,1)
  437.     carriercheck on
  438.   close #ff
  439.   TimeStringToTime("hh:mm", LDStartTemp, LdStart)
  440.   TimeStringToTime("hh:mm", LDStoptemp, LdStop)
  441. end if
  442.  
  443. CLS
  444. center "Hello!", 15,0
  445. center bbsname+" presents @0D@DuCall@0E@, a Wildcat! callback verifier", 14,0
  446. if ansidetected then
  447.   typeit "by Dimensions Unlimited", 0,3,0
  448.   center "&",6,0
  449.   shiftit "Your Sysop: "+rtrim(sysopname),0,14,8
  450. else
  451.   center "by Dimensions Unlimited", 3,0
  452.   center "&",6,0
  453.   center "Your Sysop: "+rtrim(sysopname),14,8
  454. end if
  455. if all_ld=0 then
  456.   center string(70,"═"),15,0
  457.   center "DuCall v"+ducallver,10,0
  458.   center string(70,"═"),15,0
  459. else
  460.   color 15,0
  461.   print string(79, "═")
  462.   center "DuCall v"+ducallver,10,0
  463.   Color 15,0
  464.   print string(79,"═")
  465. end if
  466.  
  467. if (user.Seclevel <> presec) and (user.Seclevel <> sysopsec) then
  468.   pcolor=14
  469.   print chr(13);"@"+right(hex(pcolor),2)+"@";
  470.   Print
  471.   Print "You have already been verified!  There is no need to access this"
  472.   Print "Callback verifier again.  Thanks!"
  473.   Print
  474.   dummy=" This user had been previously verified! "
  475.   audittrail
  476.   waitkp
  477.   end
  478. End if
  479.  
  480. pcolor=11
  481. print chr(13);"@"+right(hex(pcolor),2)+"@";
  482. if all_ld=0 then
  483.   if ld=0  then
  484.       print
  485.       print"     Your Sysop has disabled Long Distance Call-Back verification."
  486.       print
  487.       print"     If you are calling from a toll area or long distance, you cannot use"
  488.       print"     this verifier.  You must wait 24 hours for upgrade.  Just leave us a"
  489.       print"     note and we will get you going.  If you are calling locally, then"
  490.       print"     please continue on."
  491.   else
  492.     print
  493.     print"     Your Sysop allows Long Distance Call-Back verification!"
  494.     print
  495.     ChkLdTime
  496.     IF ldvfyok=False then
  497.       Print"     but.... the system only will only do long distance verification"
  498.       Print"     between ";FormatTime(LDStart,"hh:mmte"); " and "FormatTime(LDStop,"hh:mmte");". If you are calling Long Distance,"
  499.       print"     please call back during those hours.  Thanks!"
  500.       print
  501.       doit = inputmask("     Are you calling Long Distance? ","Y")
  502.       if Doit="Y" then
  503.         currenttime(timenow)
  504.         gosub topscreen
  505.         pcolor=11
  506.         print chr(13);"@"+right(hex(pcolor),2)+"@";
  507.         print "     Please call back during the allowed hours.  Once again, those hours"
  508.         Print "     are between ";FormatTime(LDStart,"hh:mmte"); " and "FormatTime(LDStop,"hh:mmte");"."
  509.         print
  510.         print "     Current Time: ";:Color 12:Print FormatTime(timenow, "hh:mm")
  511.         dummy=" attempted L/D verification outside allowed hours"
  512.         audittrail
  513.         problem="L/D outside allowed hours"
  514.         SendSysopBadMsg
  515.         waitkp
  516.         goto DucEnd
  517.       end if
  518.     end if
  519.     Print"     Please continue on to the next step."
  520.   end if
  521. end if
  522. if all_ld=0 then
  523.   pcolor=13
  524.   print chr(13);"@"+right(hex(pcolor),2)+"@";
  525.   print
  526.   doit = inputmask("     Should I call your computer so I can verify your phone number? ","Y")
  527.   if doit="N" then
  528.     pcolor=14
  529.     print chr(13);"@"+right(hex(pcolor),2)+"@";
  530.     print
  531.     print"Okay!  Aborting. Returning to the BBS."
  532.     waitkp
  533.     dummy=" refused initial callback question"
  534.     audittrail
  535.     problem="User refused initial callback question"
  536.     SendSysopBadMsg
  537.     goto DucEnd
  538.   end if
  539.   doit=""
  540.   gosub topscreen
  541.   cscrln=csrlin
  542. end if
  543. pcolor=11
  544. print chr(13);"@"+right(hex(pcolor),2)+"@";
  545. print"  The purpose off Call-Back Verification is to protect your rights as a user."
  546. Print"  It insures that someone else is not pretending to be you, an logging on"
  547. print"  and using your time.  It also provides me with a record of phone numbers"
  548. print"  I can use to compare against other users in the Data Base, to make sure"
  549. print"  your account is not being violated."
  550. print
  551. print"  After you have completed the verification, you will be upgraded on the spot"
  552. print"  to a status that is set for Non-Subscribers to this system.  If you have"
  553. print"  any questions at all, please post me, ";rtrim(sysopname);","
  554. print"  a message from the main menu."
  555. print
  556. waitkp
  557. cls
  558. gosub topscreen
  559. print"  In a moment you will be asked for your Areacode, Prefix and Extension. You"
  560. print"  will have a chance to make changes in the event you entered the wrong"
  561. print"  information.  The proceedures are pretty straight forward, so you should"
  562. print"  have no trouble getting through this."
  563. print
  564. waitkp
  565. cls
  566. gosub topscreen
  567. do
  568.   cscrln=csrlin
  569.   do
  570.     pcolor=10
  571.     print chr(13);"@"+right(hex(pcolor),2)+"@";
  572.     areacode=inputmask("Enter your  AreaCode: ","999")
  573.     prefix=inputmask("Enter your   Pre-Fix: ","999")
  574.     extension=inputmask("Enter your extension: ","9999")
  575.     print
  576.     dummy=" ["+areacode+"] "+prefix+"-"+extension+" entered"
  577.     audittrail
  578.     if len(trim(areacode))<>3 or len(trim(prefix))<>3 or len(trim(extension))<>4 then
  579.       pcolor=15
  580.       print chr(13);"@"+right(hex(pcolor),2)+"@";
  581.       print "We can not accept blanks in your data entry."
  582.       print
  583.       doit=inputmask("Quit? ","Y")
  584.       if doit="Y" then
  585.         dummy=" user aborting "
  586.         audittrail
  587.         problem="User Refused to answer Phone # Question"
  588.         SendSysopBadMsg
  589.         goto DucEnd
  590.       end if
  591.     else
  592.       pcolor=15
  593.       print chr(13);"@"+right(hex(pcolor),2)+"@";
  594.       dummy="Is @0E@["+areacode+"] "+prefix+"-"+extension+"@0F@ correct? "
  595.       doit=inputmask(Dummy,"Y")
  596.       if doit="Y" then exit do
  597.     end if
  598.     cls
  599.     gosub topscreen
  600.   loop
  601.   cls
  602.   gosub topscreen
  603.   pcolor=10
  604.   print chr(13);"@"+right(hex(pcolor),2)+"@";
  605.   print
  606.   print "Scanning user database for duplicate phone numbers..."
  607.   print "Your number: ";"@0E@["+areacode+"] "+prefix+"-"+extension+"@0F@"
  608.   phonenum=areacode+"-"+prefix+"-"+extension
  609.   dupenumber=0
  610.   if GetUser(UserRec,"") then
  611.     DO
  612.       thisrecord=0
  613.       '
  614.       if rtrim(userrec.phonenumber) = phonenum and userrec.name <> user.name  then
  615.          dupenumber=dupenumber+1
  616.          thisrecord=1
  617.          pcolor=10
  618.          print chr(13);"@"+right(hex(pcolor),2)+"@";
  619.          Print "Duplicate Voice Number found: ";
  620.          pcolor=14
  621.          print "@"+right(hex(pcolor),2)+"@";
  622.          print userrec.phonenumber
  623.          dummy=" duplicate voice number found in user database "
  624.          audittrail
  625.          if dupenumber>(duplicatenumbers+1) then exit do
  626.       end if
  627.       if rtrim(userrec.datanumber) = phonenum and userrec.name <> user.name then
  628.          pcolor=10
  629.          print chr(13);"@"+right(hex(pcolor),2)+"@";
  630.          Print "Duplicate Data  Number found: ";
  631.          pcolor=14
  632.          print "@"+right(hex(pcolor),2)+"@";
  633.          print userrec.datanumber
  634.          if thisrecord<>1 then dupenumber=dupenumber+1:thisrecord=1
  635.          dummy=" duplicate data number found in user database "
  636.          audittrail
  637.          if dupenumber>(duplicatenumbers+1) then exit do
  638.       end if
  639.       if rtrim(userrec.faxnumber) = phonenum and userrec.name <> user.name then
  640.          pcolor=10
  641.          print chr(13);"@"+right(hex(pcolor),2)+"@";
  642.          Print "Duplicate Fax   Number found: ";
  643.          pcolor=14
  644.          print "@"+right(hex(pcolor),2)+"@";
  645.          print userrec.faxnumber
  646.          if thisrecord<>1 then dupenumber=dupenumber+1:thisrecord=1
  647.          dummy=" duplicate fax number found in user database "
  648.          audittrail
  649.          if dupenumber>(duplicatenumbers+1) then exit do
  650.        end if
  651.     Loop until not GetNextUser(UserRec)
  652.   end if
  653.   y=0
  654.   print
  655.   if dupenumber>=1 then
  656.     pcolor=10
  657.     print chr(13);"@"+right(hex(pcolor),2)+"@";
  658.     print "The phone number you entered is already in the user database!"
  659.     print
  660.     if duplicatenumbers=0 then
  661.       print "Only one user can be verified per phone number."
  662.     else
  663.       print "The Sysop allows ";duplicatenumbers; " extra user verification(s) at your"
  664.       print "phone number. Currently, there is ";str(dupenumber); " users verified at"
  665.       print "your location."
  666.       print
  667.       if dupenumber>duplicatenumbers then
  668.         print "Sorry, we can not automatically verify more users for your location."
  669.         print
  670.         waitkp
  671.       else
  672.         y=1
  673.       end if
  674.     end if
  675.     if y=0 then
  676.       pcolor=15
  677.       print chr(13);"@"+right(hex(pcolor),2)+"@";
  678.       doit=inputmask("Do you wish to re-enter your phonenumber? ","Y")
  679.       if doit="N" then
  680.         dummy=" the user is exiting "
  681.         audittrail
  682.         problem=str(dupenumber)+" user(s) already verified at this phone number"
  683.         SendSysopBadMsg
  684.         goto DucEnd
  685.       end if
  686.     else
  687.       dummy=" allowing a duplicate number verification "
  688.       audittrail
  689.       exit do
  690.     end if
  691.   else
  692.     dummy=" number is new to the database "
  693.     audittrail
  694.     exit do
  695.   end if
  696.   dummy=" user is re-entering the phone number "
  697.   audittrail
  698.   cls
  699.   gosub topscreen
  700. loop
  701. '
  702. IF  DupeNumber=0 then
  703.   print
  704.   print "Your phone number was not found in the User Data Base.  That is good!"
  705.   print
  706. end if
  707. waitkp
  708. '
  709. if all_ld=0 or UseLocal=0 then
  710.   cls
  711.   gosub topscreen
  712.   '
  713.   print
  714.   print "Checking your number against a database of local phone number prefixes...";
  715.   ff=freefile:prefixmatch=0
  716.   open ProgPath+"DUCCLOCL.CFG" for input as #ff
  717.     carriercheck off
  718.     lockfile(ff,0,1)
  719.     do while not eof(ff)
  720.       input #ff, temp
  721.         if left(temp,1)<>";" then
  722.           if left(UCASE(temp),4)<>"AREA" or left(ucase(temp),4)<>"ENDA" then
  723.             if left(phonenum,7)=left(temp,7) then prefixmatch=1: exit do
  724.           end if
  725.         end if
  726.     loop
  727.     unlockfile(ff,0,1)
  728.     carriercheck on
  729.   close #ff
  730.   print
  731.   if prefixmatch=1 then
  732.     print
  733.     print "Match! We have a match.  The number you have entered is confirmed to be a"
  734.     print "local telephone call."
  735.     print
  736.     waitkp
  737.     dummy=" telephone prefix match! It's a local call "
  738.     audittrail
  739.     phone=right(rtrim(phonenum),8)
  740.   else
  741.     if ld=0 then
  742.       print
  743.       print "Sorry, for some reason, your telephone prefix is not in our extensive Data"
  744.       print "Base of local phone number prefixes.  Please leave the Sysop a message"
  745.       print "and tell the sysop your phone number prefix so that he can get the data"
  746.       print "base updated. Are you calling long distance?  We can not verify long"
  747.       print "distance callers."
  748.       print
  749.       dummy=" the prefix given is not in DucClocl.CFG "
  750.       audittrail
  751.       Problem="Caller's prefix not in database of local phone number pre-fixes"
  752.       SendSysopBadMsg
  753.       waitkp
  754.       goto DucEnd
  755.     else
  756.       ChkLdTime
  757.       IF ldvfyok=false then
  758.         cls
  759.         gosub topscreen
  760.         print
  761.         print "Your phone number must be long distance from this BBS.  If not your"
  762.         print "telephone prefix was not in our extensive Data Base of local phone"
  763.         print "number prefixes."
  764.         print
  765.         print "Long Distance verification is only allowed between the hours of ";FormatTime(LdStart, "hh:mmte"); " and ";FormatTime(LdStop, "hh:mmte");"."
  766.         print "Please try back during those hours. Thanks!"
  767.         print
  768.         print "If you are local, please send the Sysop a message (comment) and tell the"
  769.         print "Sysop your phone number prefix so that he can get the database of local"
  770.         print "phone numbers updated."
  771.         print
  772.         dummy=" attempted L/D verification outside allowed hours"
  773.         audittrail
  774.         problem="L/D outside allowed hours"
  775.         SendSysopBadMsg
  776.         waitkp
  777.         goto DucEnd
  778.       end if
  779.       '
  780.       print
  781.       print "Your phone number must be long distance from this BBS.  If not your"
  782.       print "telephone prefix was not in our extensive Data Base of local phone"
  783.       print "number prefixes.  If you are local, please send the Sysop a message"
  784.       print "and tell the Sysop your phone number prefix so that he can get the"
  785.       print "database of local phone numbers updated."
  786.       print
  787.       temp=inputmask("Is your Phone Number Long Distance from this BBS? ","Y")
  788.       if temp="N" then
  789.         print "Please leave the sysop a note with your prefix.  Thanks!"
  790.         dummy=" the prefix given is not in DucClocl.CFG "
  791.         audittrail
  792.         Problem="User Reports that their prefix is not in the database of local phone number pre-fixes"
  793.         SendSysopBadMsg
  794.         waitkp
  795.         goto DucEnd
  796.       else
  797.         dialld=1
  798.         print
  799.         temp=inputmask("Should your number be dialed: 1-"+phonenum+"? ","Y")
  800.         if temp="Y" then
  801.           phonenum="1-"+phonenum
  802.         else
  803.           print
  804.           temp=inputmask("Should your number be dialed: 1-"+right(rtrim(phonenum),8)+"? ","Y")
  805.           if temp="Y" then
  806.             phonenum="1-"+right(rtrim(phonenum),8)
  807.           else
  808.             print
  809.             print "Are you local?  This call back verifier is confused!"
  810.             print
  811.             waitkp
  812.             dummy=" confused - long distance? "
  813.             audittrail
  814.             problem="User and DuCall Confused. L/D ?"
  815.             SendSysopBadMsg
  816.             goto DucEnd
  817.           end if
  818.         end if
  819.       end if
  820.     end if
  821.   end if
  822. else
  823.   if all_ld=1 then
  824.     phonenum="1-"+phonenum
  825.   elseif UseLocal=0 then
  826.     dummy = " asking user how to dial phone"
  827.     AuditTrail
  828.     temp=inputmask("Should your number be dialed: "+right(rtrim(phonenum),8)+"? ","Y")
  829.     IF Temp="Y" then
  830.       phone=right(rtrim(phonenum),8)
  831.     else
  832.       temp=inputmask("Is your Phone Number Long Distance from this BBS? ","Y")
  833.       if temp="N" then
  834.         print "It seems to us that you're confused.  Please leave a comment for the Sysop."
  835.         dummy=" user confused, exiting"
  836.         audittrail
  837.         Problem="User Confused. He/she can not tell us how to dial the phone"
  838.         SendSysopBadMsg
  839.         waitkp
  840.         goto DucEnd
  841.       else
  842.         dialld=1
  843.         print
  844.         temp=inputmask("Should your number be dialed: 1-"+phonenum+"? ","Y")
  845.         if temp="Y" then
  846.           phonenum="1-"+phonenum
  847.         else
  848.           print
  849.           temp=inputmask("Should your number be dialed: 1-"+right(rtrim(phonenum),8)+"? ","Y")
  850.           if temp="Y" then
  851.             phonenum="1-"+right(rtrim(phonenum),8)
  852.           else
  853.             print
  854.             print "Are you local?  This call back verifier is confused!"
  855.             print
  856.             waitkp
  857.             dummy=" confused - long distance? "
  858.             audittrail
  859.             problem="User and DuCall Confused. L/D ?"
  860.             SendSysopBadMsg
  861.             goto DucEnd
  862.           end if
  863.         end if
  864.       end if
  865.     end if
  866.   end if
  867. end if
  868. '
  869. cls
  870. gosub topscreen
  871. '
  872. gosub checkphone
  873. '
  874. print
  875. print "  We will be calling you back shortly at: ";phone
  876. print
  877. print "  It can take anywhere from 5-45 seconds after you type ATA, before our"
  878. print "  modems re-connect.  Please be patient...."
  879. print
  880. print "  When you see the word RING, type ATA then press ENTER"
  881. print
  882. print "  We will now call you back at your number.."
  883. print
  884. waitkp
  885. '
  886. cls
  887. gosub topscreen
  888. '
  889. print
  890. print" Hanging up .. wait at least a minute or two for my callback ..."
  891. print" then type ATA<return> on your terminal when you hear the ring!"
  892. print" YOU MUST ANSWER WITHIN 45 SECONDS!!!!"
  893. print
  894. print" If DuCall doesn't susceed on its first attempt to connect with you,"
  895. print" it will try ";str(tries-1); " more times.  DuCall will make up to";
  896. print" ";str(tries);  " calls total."
  897. print
  898. dummy=" is attempting callback"
  899. audittrail
  900. '
  901. CarrierCheck Off
  902. z=0
  903. do
  904.   Hangup
  905.   z=z+1
  906.   Delay 5
  907.   cls
  908.   Send "+++"+ chr(13)
  909.   Delay 5
  910.   Send "ATZ" + chr(13)
  911.   Delay 5
  912.   Send "ATDT" + phone + chr(13)
  913.   StartTime=Timer
  914.   ff=freefile
  915.   open "MODEM.DMP" for output as #ff
  916.   do
  917.     lockfile(ff,0,1)
  918.     print #ff, INCOMM;
  919.     unlockfile(ff,0,1)
  920.     if timer-starttime<0 then
  921.       if (86400-starttime)+timer>60 then
  922.         send chr(13):exit do
  923.       end if
  924.     end if
  925.     if timer-starttime>60 then
  926.       send chr(13)
  927.       exit do
  928.     end if
  929.   loop until carrier
  930.   close #ff
  931.   if z>=tries then
  932.     Dialing=1
  933.     dummy=" too many tries aborting "
  934.     audittrail
  935.     problem="User did not answer the phone after "+Str(z)+" tries."
  936.     SendSysopBadMsg
  937.     Dialing=0
  938.     if exists("MODEM.DMP") then KILL "MODEM.DMP"
  939.     carriercheck on
  940.     goto DucEnd
  941.   end if
  942. Loop until Carrier
  943. delay 1
  944. do
  945. loop until INCOMM=""
  946. dummy=" connected with user "
  947. audittrail
  948. carriercheck on
  949. '
  950. x=0:y=0
  951. '
  952. do
  953.   CLS
  954.   print"connected on ";str(z); " attempt!"
  955.   print
  956.   center "This is "+bbsname+" calling to verify you.",15,0
  957.   print
  958.   pcolor=10
  959.   print chr(13);"@"+right(hex(pcolor),2)+"@";
  960.   name1 = inputmask("     Please enter your login name now: ","XXXXXXXXXXXXXXXXXXXXXXXXX")
  961.   name1=ucase(name1)
  962.   '
  963.   If user.name = name1 then
  964.     y=0
  965.     Do
  966.       print
  967.       password1=inputmask("     Please enter your password now: ","XXXXXXXXXXXXXX")
  968.       password1=ucase(password1)
  969.       y=y+1
  970.       if user.password = password1 then exit do
  971.       if y=3 then
  972.         print
  973.         print "You have had 3 incorrect password attempts.  Try calling the BBS back"
  974.         print "and start the verification process again."
  975.         dummy=" user could not re-enter his password correctly! "
  976.         audittrail
  977.         problem="Called User/Bad Password Entered"
  978.         SendSysopBadMsg
  979.         goto DucEnd
  980.       end if
  981.     Loop
  982.   end if
  983.   '
  984.   if user.password = password1 then
  985.      gosub topscreen
  986.      color 14
  987.      print "Verified!"
  988.      print
  989.      if user.Seclevel <> "SYSOP" then user.Seclevel = aftersec
  990.      if ExpireDays>0 then
  991.        CurrentDate(ExpireDate)
  992.        IncDate ExpireDate, ExpireDays,0,0
  993.        user.expiredate=ExpireDate
  994.        dummy=" user expiration date set at: "+Formatdate(ExpireDate, dfmat)
  995.        AuditTrail
  996.        color 15,0
  997.        print
  998.        print "Your trial subscription to this system has been established!"
  999.        print
  1000.        print "Your subscription expiration date has been set to: ";
  1001.        color 12,0
  1002.        print FormatDate(ExpireDate, dfmat)
  1003.        color 11,0
  1004.        print
  1005.        print "At that time your user level will be down-graded back to non-verified"
  1006.        print "and/or your user record will be deleted.  Please check with the sysop"
  1007.        print "and the bulletin menu for information on subscribing to this system."
  1008.        print
  1009.        waitkp
  1010.        gosub topscreen
  1011.      end if
  1012.      user.datanumber = phonenum
  1013.      if commentline>=1 and commentline<=5 then
  1014.        user.comment(commentline)="pw: "+user.password
  1015.      end if
  1016.      if timebalance>0 then
  1017.        user.subscriptionbalance=user.subscriptionbalance+timebalance
  1018.        dummy=" subscription balance increased by "+str(timebalance)+" "
  1019.        audittrail
  1020.        color 15
  1021.        print
  1022.        print "Your time balance has been increased by ";timebalance;" minutes."
  1023.        print "Withdraw that time and use it to look around the system."
  1024.        print
  1025.        print "Typically you can access the time bank from the main menu."
  1026.        print
  1027.        waitkp
  1028.        gosub topscreen
  1029.      end if
  1030.      dummy=" successfully upgraded"
  1031.      audittrail
  1032.      pcolor=15
  1033.      print chr(13);"@"+right(hex(pcolor),2)+"@";
  1034.      print
  1035.      print "Your security level has successfully been upgraded!"
  1036.      if all_ld=1 then
  1037.        color 11
  1038.        print
  1039.        Print "The call back verifier will now hang up.  Wait a minute and then call"
  1040.        print "us back.  You will now have access to ";
  1041.        color 12
  1042.        print bbsname;:color 11:Print "."
  1043.        print
  1044.        print "Enjoy the system!"
  1045.        SendWelcomeMessage
  1046.        dummy=" User Verified! - hanging up "
  1047.        audittrail
  1048.        Carriercheck Off
  1049.        Hangup
  1050.        delay 30
  1051.        goto DucEnd
  1052.      end if
  1053.      '
  1054.      if ld=1 and dialld=1 then
  1055.        print
  1056.        print "You are long distance, therefore we are hanging up now.  Wait a minute"
  1057.        print "and call us back."
  1058.        print
  1059.        SendWelcomeMessage
  1060.        dummy=" Long Distance Verified - hanging up "
  1061.        audittrail
  1062.        Carriercheck Off
  1063.        Hangup
  1064.        delay 30
  1065.        goto DucEnd
  1066.      end if
  1067.      SendWelcomeMessage
  1068.      print
  1069.      Print"     You have new mail ..."
  1070.      print
  1071.      if InputYesNo("    Read messages now? (YN) ") then
  1072.         print
  1073.         print "to read the messages you have waiting, please answer the"
  1074.         print "following questions by TYPING a 'U' then an 'A'"
  1075.         print
  1076.         ReadMessages
  1077.      end if
  1078.      exit do
  1079.   end if
  1080.   '
  1081.   x=x+1
  1082.   if x=20 then
  1083.     print"Too many wrong guesses.  Call the board and start over."
  1084.     dummy= " failed verification of name"
  1085.     audittrail
  1086.     problem="Called Back/Too many Guesses"
  1087.     SendSysopBadMsg
  1088.     hangup
  1089.     goto DucEnd
  1090.   end if
  1091.   '
  1092. loop
  1093.  
  1094. DucEnd:
  1095. dummy =string(79,"─")
  1096. audittrail
  1097. gotomenu(mainmenu)
  1098. end
  1099.  
  1100. TopScreen:
  1101. cls
  1102. center "DuCall version "+ducallver,7,0
  1103. center string(50,"═"),15,0
  1104. Center "C A L L - B A C K    V E R I F I C A T I O N",13,0
  1105. center string(50,"═"),15,0
  1106. center "Written by David Kuhn    Copyright(c) 1995",7,0
  1107. print
  1108. pcolor=15
  1109. print chr(13);"@"+right(hex(pcolor),2)+"@";
  1110. print string(79, "═")
  1111. Return
  1112.  
  1113. CheckPhone:
  1114. if left(phonenum,3) = "911" then
  1115.   print
  1116.   print "We can't call 911, Ideot!"
  1117.   delay 5
  1118.   dummy=" user wanted us to call 911! "
  1119.   audittrail
  1120.   Problem="User tried to have us call 911!"
  1121.   SendSysopBadMsg
  1122.   goto DucEnd
  1123. end if
  1124. if left(right(rtrim(phonenum),8),3) = "911" then
  1125.   print
  1126.   print "We can't call 911, Ideot!"
  1127.   delay 5
  1128.   dummy=" user wanted us to call 911! "
  1129.   audittrail
  1130.   Problem="User tried to have us call 911!"
  1131.   SendSysopBadMsg
  1132.   goto DucEnd
  1133. end if
  1134. if left(phonenum,3) = "411" then
  1135.   print
  1136.   print "We can't call 411, Ideot!"
  1137.   delay 5
  1138.   dummy=" user wanted us to call 411! "
  1139.   audittrail
  1140.   Problem="User tried to have us call 411!"
  1141.   SendSysopBadMsg
  1142.   goto DucEnd
  1143. end if
  1144. if left(right(rtrim(phonenum),8),3) = "411" then
  1145.   print
  1146.   print "We can't call 411, Ideot!"
  1147.   delay 5
  1148.   dummy=" user wanted us to call 411! "
  1149.   audittrail
  1150.   Problem="User tried to have us call 411!"
  1151.   SendSysopBadMsg
  1152.   goto DucEnd
  1153. end if
  1154. if left(right(rtrim(phonenum),8),3) = "900" then
  1155.   print
  1156.   print "We can't call numbers, Ideot!"
  1157.   delay 5
  1158.   dummy=" user wanted us to call a 900 number! "
  1159.   audittrail
  1160.   problem="User tried to have us call a 900 number!"
  1161.   SendSysopBadMsg
  1162.   goto DucEnd
  1163. end if
  1164. if left(right(rtrim(phonenum),8),3) = "800" then
  1165.   print
  1166.   print "We can't call 800 numbers!"
  1167.   delay 5
  1168.   dummy=" user wanted us to call a 800 number! "
  1169.   audittrail
  1170.   problem="User tried to have us call a 800 number!"
  1171.   SendSysopBadMsg
  1172.   goto DucEnd
  1173. end if
  1174. if left(phonenum,3)="555" then
  1175.   print
  1176.   print "We can't call Hollywood, Silly!"
  1177.   delay 5
  1178.   dummy=" user wanted us to call Hollywood! "
  1179.   audittrail
  1180.   problem="User tried to have us call Holywood!"
  1181.   SendSysopBadMsg
  1182.   goto DucEnd
  1183. end if
  1184. if Left(right(rtrim(phonenum),8),3)="555" then
  1185.   print
  1186.   print "We can't call Hollywoood, Silly!"
  1187.   delay 5
  1188.   dummy=" user wanted us to call Hollywood! "
  1189.   audittrail
  1190.   problem="User tried to have us call Holywood!"
  1191.   SendSysopBadMsg
  1192.   goto DucEnd
  1193. end if
  1194. if right(rtrim(phonenum),8)="555-1212" then
  1195.   print
  1196.   print "We can't call information, Ideot!"
  1197.   delay 5
  1198.   dummy=" user wanted us to call information! "
  1199.   audittrail
  1200.   problem="User tried to have us call Information!"
  1201.   SendSysopBadMsg
  1202.   goto DucEnd
  1203. end if
  1204. return
  1205.  
  1206. end